package pers.wensheng.patterns.behavioral_pattern.interpreter_pattern.entity;

import lombok.AllArgsConstructor;
import pers.wensheng.patterns.behavioral_pattern.interpreter_pattern.Context;

/**
 * 终结符表达式角色
 */
@AllArgsConstructor
public class Value extends AbstractExpression {
    private int value;

    @Override
    public int interpret(Context context) {
        return value;
    }

    @Override
    public String toString() {
        return new Integer(value).toString();
    }
}
